package org.seedltd.upms.model.sys.form;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.seedltd.core.validation.Save;
import org.seedltd.core.validation.Update;
import org.seedltd.upms.enums.EnableStatus;

import lombok.Getter;
import lombok.Setter;

/**
 * 部门表控制器
 *
 * @author laizuan
 * @version 1.0
 * @since 2020/08/06
 */
@Getter
@Setter
public class SysDeptForm {


    /**
     * 部门id
     */
    @NotNull(message = "部门id不能为空", groups = {Update.class})
    private Long deptId;


    /**
     * 父部门id
     */
    private Long parentId;


    /**
     * 部门名称
     */
    @Length(message = "部门名称长度不能超过20个字符", max = 20, groups = {Update.class, Save.class})
    @NotBlank(message = "部门名称不能为空", groups = {Update.class, Save.class})
    private String deptName;


    /**
     * 部门代码
     */
    @Length(message = "部门代码长度不能超过10个字符", max = 10, groups = {Update.class, Save.class})
    @NotBlank(message = "部门代码不能为空", groups = {Update.class, Save.class})
    private String deptCode;


    /**
     * 显示顺序
     */
    @NotNull(message = "排序不能为空", groups = {Update.class, Save.class})
    private Integer sortNo;


    /**
     * 负责人
     */
    @Length(message = "负责人长度不能超过20个字符", max = 20, groups = {Update.class, Save.class})
    private String leader;


    /**
     * 联系电话
     */
    @Length(message = "联系电话长度不能超过15个字符", max = 15, groups = {Update.class, Save.class})
    private String phone;


    /**
     * 邮箱
     */
    @Length(message = "邮箱长度不能超过50个字符", max = 50, groups = {Update.class, Save.class})
    private String email;


    /**
     * 部门状态（1正常 0停用）
     */
    @NotNull(message = "部门状态不能为空", groups = {Update.class, Save.class})
    private EnableStatus enabled;

}
